/**
 * created by guyi 2018.01.19
 */
'use strict';
var express = require('express')
var router = express.Router()
const Post = require('../models/Post')
const Comment = require('../models/Comment')
var jwt = require('jsonwebtoken')
var yzmService = require("../routes/yzmService");
var UserService = require('../services/UserService')
const PostService = require('../services/PostService')

function comment (req, res, next) {
    var {nickname, parent_objectID, content} = req.body;

    //TODO token validate AND save comment
    var ComemntEntity = new Comment(req.body);
    ComemntEntity.save((err, doc) => {
        if (err) {
            console.log(err);
        } else {
            res.send('commentsuccessfully');
        }
    })
}

module.exports = {comment};